package sakila.bll;

import java.util.List;

import sakila.commonprocess.ProcessResult;
import sakila.dto.film.BaseDTO;
import sakila.sakilaexcetion.SakilaException;

/**
 * The Interface contain common operation in business logic layer.
 */
public interface IBiz
{

	/**
	 * Delete.
	 * 
	 * @param idToDelete the id to delete
	 * @return the process result
	 * @throws SakilaException the sakila exception
	 */
	public ProcessResult delete(int idToDelete) throws SakilaException;

	/**
	 * Gets the all.
	 * 
	 * @param <T> the generic type
	 * @return the all record in table in database
	 * @throws SakilaException the sakila exception
	 */
	public <T extends BaseDTO> List<T> getAll() throws SakilaException;

	/**
	 * Gets the record by id.
	 * 
	 * @param <T> the generic type
	 * @param id the id
	 * @return the record in table in database
	 * @throws SakilaException the sakila exception
	 */
	public <T extends BaseDTO> T getById(int id) throws SakilaException;

	/**
	 * Insert.
	 * 
	 * @param objToInsert the object to insert
	 * @return the process result
	 * @throws SakilaException the sakila exception
	 */
	public ProcessResult insert(BaseDTO objToInsert) throws SakilaException;

	public ProcessResult update(BaseDTO objToInsert) throws SakilaException;

	/**
	 * Validate to insert.
	 * 
	 * @param objToInsert the object to insert
	 * @return the process result
	 * @throws SakilaException the sakila exception
	 */
	public ProcessResult validateToInsert(BaseDTO objToInsert) throws SakilaException;

	/**
	 * Validate to update.
	 * 
	 * @param objToInsert the object to insert
	 * @return the process result
	 * @throws SakilaException the sakila exception
	 */
	public ProcessResult validateToUpdate(BaseDTO objToInsert) throws SakilaException;

}
